package com.gton.io;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @description: 分页参数对象
 * 贫血型模型
 * @author: GuoTong
 * @createTime: 2022-09-24 13:31
 * @since JDK 1.8 OR 11
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BasePage implements Serializable {

    /**
     * Description:  当前页 || 默认是从第一页开始
     *
     * @author: GuoTong
     * @date: 2022-09-24 13:32:36
     */
    protected long pageIndex = 1;


    /**
     * Description:  每页显示条数 || 默认是每页展示10条
     *
     * @author: GuoTong
     * @date: 2022-09-24 13:32:36
     */
    protected long pageSize = 10;


    public long getPageIndex() {
        if (this.pageIndex <= 1) {
            this.pageIndex = 1;
        }
        return pageIndex;
    }

    public long getPageSize() {
        if (this.pageSize <= 1) {
            this.pageSize = 10;
        }
        return pageSize;
    }


}
